#include <bits/stdc++.h>
using namespace std;
int a[300001];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + n + 1);
  int L = 1, R = n;
  int ans = 0;
  while (a[L] < 0 && a[R] > 0) {
    if (abs(a[L]) > abs(a[R])) {
      L++;
    } else if (abs(a[L]) < abs(a[R])) {
      R--;
    } else {
      int k1 = 0, k2 = 0;
      do {
        L++;
        k1++;
      } while (a[L] == a[L - 1]);

      do {
        R--;
        k2++;
      } while (a[R] == a[R + 1]);
      ans += k1 * k2;
    }
  }
  int k = 0;
  for (int i = L; i <= R; i++) {
    if (a[i] == 0)
      k++;
  }
  ans += k * (k - 1) / 2;

  cout << ans;

  return 0;
}